an integrated development environment specifically for python - developed by the Czech company JetBrains - the community edition provides an intelligent editor, graphical debugger, refactorings, code inspections and version control integration
brew cask install pycharm-ce| Description | Shortcut |
|---|---|
| Preferences | CMD + , |
| Jump to definition | CMD + B |
| Popup of recent files | CMD + E |
| Parameter info | CMD + P |
| Find action | CMD + SHIFT + A |
| Code completion | CTRL + SPACE |
| Move between methods | CTRL + UP/DOWN |
| F1 | View documentation popup |
Personal setup - modified using Preferences > Keymap:
| Description | Shortcut | Keymap location |
|---|---|---|
| Execute in python console | CMD + ENTER | Plug-Ins/Python Community Edition/Execute Selection In Python Console |
| Comment/uncomment | SHIFT + CMD + C | Main menu/Code/Comment with Line Comment |
| Auto-indent | CMD + I | Main menu/Code/Auto-Indent Lines |
| Toggle soft-wrap | SHIFT + CMD + W | Main menu/View/Active Editor/Soft-Wrap |
| Run | SHIFT + CMD + S | Main menu/Run/Run |
| Debug | SHIFT + CMD + D | Main menu/Run/Debug |
| what | where |
|---|---|
| Custom font | Preferences > Appearance & Behaviour > Appearance |
| Default project directory | Preferences > Appearance & Behaviour > System Settings |
| Don’t open previous projects | Preferences > Appearance & Behaviour > System Settings > Reopen last project on startup |
| Soft wrap | Preferences > General > Console |
| Custom font | Preferences > Editor > Font |
| Vertical guidelines | Preferences > Editor > Code Style > General > Visual guides: 72,79 columns |
| Templates | Preferences > Editor > File and Code Templates |
| Plugins | Preferences > Plugins |
| Default interpreter | Preferences > Project > Project Interpreter |
| IPython console | Preferences > Build, Execution, Deployment > Console > Use IPython if available |
| Docstring format | Preferences > Tools > Python Integrated Tools > Docstrings > File and Code Templates |
My personal setup:
| What | Move to |
|---|---|
| Python Console | Bottom Top |
| Terminal | Bottom Right |
| Todo | Bottom Right |
| Run | Bottom Right |
Window > Use current layout as default
Use IPython if available (i.e. installed in your python env)
Preferences > Build, Execution, Deployment > ConsoleUse IPython if availableAdd visual guidelines:
See https://pep8.org/#maximum-line-length
Preferences > Editor > Code Style > General > Visual guides: 72,79 columns
Preferences > Plugins
File > Other settings > Project Interpreter
Emulate termnal in output console to see progress progress bars.within the project, right click on the project folder wand then click New > Python file
set the project interpreter
this will be the interpreter used in the pycharm python console
e.g. to set the interpreter to an existing conda env
PyCharm >
Preferences >
Project: [my project] >
Project Interpreter >
Project Interpreter... >
[Settings wheel] >
Add... >
Conda Environment >
Existing Environment >
Interpreter
then choose make available to all projects (if you want it to be)
Dont forget to Apply before clicking Ok
things to note:
Tools > Pycharm console...Run > Run >
then either:
select file from drop down to use existing interpreter etc, oredit configurations to change interpreter and/or command args etc.things to note:
Runedit configurations windowFile > Open Recent
PyCharm >Preferences >Appearances & Behaviour >Keymap| shortcut | action |
|---|---|
CTRL R |
run script from terminal |
CTRL SPACE |
help with code completion |
CTRL UP/DOWN |
move between methods in editor |
CTRL + OPTION + I |
auto indent selection |
CMD / |
auto comment/uncomment lines |
CMD , |
open preferences |
CMD B |
jump to function definition |
CMD E |
opens a popup of recently visited files |
CMD P |
view parameter info |
CMD SHIFT A |
open ‘Find Action’ utility |
SHIFT OPTION E |
run line / selection in python console |
| shortcut | action |
|---|---|
CMD + |
expand section |
CMD - |
collapse section |
SHIFT CMD + |
expand all sections |
SHIFT CMD - |
collapse all sections |
git integration